﻿<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRateLimitTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		// 使用这个表格来对接口访问的次数进行控制
		Schema::create('rate_limit', function(Blueprint $table){
			$table->increments('id');
			$table->string('method', 10)->nullable()->default(''); 		// HTTP方法名
			$table->string('url', 1000)->nullable()->default(''); 		// 访问url
			$table->string('ip', 100)->nullable()->default('');         // 用户ip
			$table->string('username', 100)->nullable()->default(''); 	// 用户名
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('rate_limit');
	}

}
